#include <stdio.h>
/**
 *
 *
 **/
int main(int argc, char const *argv[])
{
	char buf[] = "hello";   //在初始化的时候,默认在结尾加结束符0
	int n = sizeof(buf)/sizeof(buf[0]);   // n = 6;
	printf("n=%d\n", n);

	char *p1 = buf;
	*p1 = 'a';
	p1 = NULL;

	//const 修饰*,指针所指向的内存不能修改
	const char *p2 = buf;

	//
	//*p2 = 'a';    //error: assignment of read-only location ‘*p2’ *p2 = 'a';
	p2 = NULL; //ok ,p2本省可以修改


	return 0;
}